package androidx.blogger;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.gdata.blogger.Blog;
import androidx.list.CellRenderer;

public class BlogRenderer implements CellRenderer<Blog> {
	private Activity parent;
	
	public BlogRenderer(Activity parent) {
		this.parent = parent;
	}
	
	public void applyDataToView(View view, Blog data) {
		TextView tv = (TextView) view;
		tv.setText(data.getTitle());
	}

	public View createViewForData(Context context, Blog data) {
		return inflate(R.layout.blog_text);
//		return new TextView(context);
	}

	public boolean isViewSuitableForData(View view, Blog data) {
		return true;
	}

	private View inflate(int resId) {
		return parent.getLayoutInflater().inflate(resId, null);		
	}
}
